#ifndef THREAD_OO_H
#define THREAD_OO_H

#include <pthread.h>
#include <unistd.h>
#include <functional>

typedef std::function<void(void)> RunCallBack;

class Thread
{
public:
    Thread(RunCallBack runFunc);
    ~Thread();

    void start();
    void join();

    static void* runInThread(void *arg);
public:
    bool m_isJoin;
    bool m_isStart;
    pthread_t m_pid;
    RunCallBack m_runFunc;
};

#endif // THREAD_OO_H
